<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<meta charset="utf-8">
<head>
    <link type="text/css" href="${pageContext.request.contextPath}/css/index.css" rel="stylesheet">
   <title>当当书城</title>
</head>
<body >
    <div id="container" align="center">
        <!--页面头部栏-->
        <div id="head">
            <iframe src="${pageContext.request.contextPath}/head.jsp" width="100%" height="100%" scrolling="no" frameborder="0">
            </iframe>
        </div>

        <!---广告栏 -->
        <div id="advertising">
            <img src="images/tu.jpg">
        </div>
        <!--页面住内容-->
        <div id="center">
            <div id="center_left">
                <h2><a href="#">分类浏览</a></h2>
                <c:forEach items="${titleOnes}" var="titleOne" begin="0" end="6">
                    <div>
                        <ul>
                            <a href="/login/booksClassServlet?doType=doQuery&type=dataInit&titleOneId=${titleOne.id}&titleTwoId=${titleOne.id*5-4}">[${titleOne.title}]</a><br>
                            <c:forEach items="${titleTwos}" var="titleTwo">
                               <c:if test="${titleOne.id==titleTwo.titleOneId&&titleTwo.id<=35}">
                                   <li><a href="/login/booksClassServlet?doType=doQuery&type=dataInit&titleOneId=${titleTwo.titleOneId}&titleTwoId=${titleTwo.id}">${titleTwo.title}</a></li>
                               </c:if>

                            </c:forEach>
                        </ul>
                    </div>
                </c:forEach>

            </div>
            <div id="center_center">
                <div id="recommend">
                    <p id="recommend1"><b>编辑推荐</b></p>
                    <c:forEach items="${books}" var="book" begin="0" end="1">
                        <div>
                            <a href="/login/booksDetailsServlet?doType=doQuery&bookId=${book.bookId}" ><img src="${book.cover}"></a>
                            <p class="recommend2">
                            <ul class="ul">
                                <li><b><a href="/login/booksDetailsServlet?doType=doQuery&bookId=${book.bookId}">书名：<span>${book.book}</span></a> </b></li>
                                <li>作者：${book.writer}</li>
                                <li>出版社：${book.press}  出版时间：${book.publicationTime}</li>
                                <li>简介:${book.intro}</li>
                                <li>定价：<span>￥${book.pricing}</span> 当当价：<span>￥${book.price}</span></li>
                            </ul>
                            </p>
                        </div>
                    </c:forEach>

                </div>

                <div id="newest">
                    <p id="p"><b>最新上架图书</b><a href="">更多》</a></p>
                    <c:forEach items="${timeBooks}" var="timeBook" begin="0" end="4" >
                        <div>
                            <a href="/login/booksDetailsServlet?doType=doQuery&bookId=${timeBook.bookId}"><img src="${timeBook.cover}"><br></a>
                            <a href="/login/booksDetailsServlet?doType=doQuery&bookId=${timeBook.bookId}" class="a" >${timeBook.book}</a><br>
                            <p>
                                定价：<span>￥${timeBook.pricing}</span><br>
                                当当价：<span>￥${timeBook.price}</span>
                            </p>
                        </div>
                    </c:forEach>


                </div>
            </div>
            <div id="center_right">
                <h3>新书热卖榜</h3>

                <c:forEach items="${salesBooks}" var="book" begin="0" end="2" varStatus="st">
                    <div>
                        <a href="/login/booksDetailsServlet?doType=doQuery&bookId=${book.bookId}"><img src="${book.cover}"><br></a>
                        <a href="/login/booksDetailsServlet?doType=doQuery&bookId=${book.bookId}">${book.book}</a><br>
                        <b>NO.${st.index+1}</b>
                    </div>
                </c:forEach>
            </div>
        </div>

        <!--页面脚注栏-->
        <div id="foot">
            <iframe src="${pageContext.request.contextPath}/foot.jsp" width="100%" height="100%" scrolling="no" frameborder="0">
            </iframe>
        </div>
    </div>
</body>
</html>
